package com.dxf.sysadmin.controller;

import com.dxf.common.utils.ResultJson;
import com.dxf.sysadmin.entity.Dept;
import com.dxf.sysadmin.entity.EvaluteTarget;
import com.dxf.sysadmin.entity.qo.MyPage;
import com.dxf.sysadmin.service.EvaluteTargetService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/admin/target")
@Api(tags  = "EvaluteTargetController|评价指标控制器")
public class EvaluteTargetController {
    @Autowired
    EvaluteTargetService evaluteTargetService;

    /**
     * @Description: 评价指标列表查询
     */
    @GetMapping("targetPage")
    @ApiOperation("评价指标列表查询")
    public ResultJson targetPage(){
        return evaluteTargetService.targetPage();
    }

    /**
     * @Description: 更具id列表删除评价指标
     */
    @DeleteMapping("delete/{id}")
    @ApiOperation(value = "更具id列表删除评价指标")
    public ResultJson deleteTarget(@PathVariable Integer id){
        return evaluteTargetService.deleteTarget(id);
    }

    /**
     * @Description: 新增或者更新评价指标
     */
    @PostMapping("saveOrUpdate")
    @ApiOperation(value="新增或者更新评价指标")
    public ResultJson saveOrUpdateTarget( @RequestBody EvaluteTarget target){
        return evaluteTargetService.saveOrUpdateTarget(target);
    }

    /**
     * @Description: 评价指标下拉选项
     */
    @GetMapping("targetSelect")
    @ApiOperation("评价指标下拉选项")
    public ResultJson targetSelect(){
        return evaluteTargetService.targetSelect();
    }
}
